import { createRouter } from "vue-router";
import {
  createWebHashHistory,
} from "vue-router";

import type { RouteRecordRaw } from "vue-router";

const routes: RouteRecordRaw[] = [
  {
    path: "/",  
    redirect: '/home'
  },
  {
    path: "/home",  
    name: 'home',
    component: () => import("../views/Home.vue"), 
    meta: {
      title: '首页'
    }
  },
  {
    path: "/login",  
    name: 'login',
    component: () => import("../views/Login.vue"), 
    meta: {
      title: '登录'
    }
  },
  {
    path: "/student",  
    name: "student",  
    component: () => import("../views/Student.vue"), 
    meta: {
      title: '学生管理'
    }
  },
  {
    path: "/user",  
    name: "user",  
    component: () => import("../views/User.vue"), 
    meta: {
      title: '用户管理'
    }
  },
  {
    path: "/role",  
    name: "role",  
    component: () => import("../views/Role.vue"), 
    meta: {
      title: '角色管理'
    }
  },
  {
    path: "/journal",  
    name: "journal",  
    component: () => import("../views/Journal.vue"), 
    meta: {
      title: '日志管理'
    }
  },
  {
    path: "/directory",  
    name: "directory",  
    component: () => import("../views/Directory.vue"), 
    meta: {
      title: '数据字典'
    }
  }
];
// 1. 创建路由器实例
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;

